﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Org/MasterPage.master" AutoEventWireup="true" CodeFile="frmO_HistoryInfoInput.aspx.cs" 
Inherits="Org_frmO_HistoryInfoInput" EnableEventValidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    本社履歴情報登録
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <script src="../js/jquery.min.js" type="text/javascript" language="javascript"></script>
    <script src="../js/Validation.js" type="text/javascript"></script>
    <style>
        .detail-admin-row .detail-admin-label
        {
            width:180px;
        }
    </style>
    <script type="text/javascript" language="javascript">


        function check_年度2(oSrc, args) {
            if ($("#<%= hd_年度.ClientID %>").val() != "" && $("#<%= hd_年度.ClientID %>").val() == $("#<%= ddl_年度.ClientID %>").val() &&
                "<%= CV_年度2.IsValid %>" == "False") {
                args.IsValid = false;
            }
          
        }


        //Cho dropdownlist
        function Check_年度_決算月1(oSrc, args) {
            if ($("#<%= hd_決算月1.ClientID %>").val() != "" && $("#<%= hd_決算月1.ClientID %>").val() == $("#<%= ddl_決算月.ClientID %>").val() &&
               "<%= CV_ddl_決算月1.IsValid %>" == "False") {
                args.IsValid = false;
            }
            if ($("#<%= hd_年度.ClientID %>").val() != $("#<%= ddl_年度.ClientID %>").val()) {
                args.IsValid = true;
            }
        }

        function Check_年度_決算月2(oSrc, args) {

            if ($("#<%= hd_決算月2.ClientID %>").val() != "" && $("#<%= hd_決算月2.ClientID %>").val() == $("#<%= ddl_決算月.ClientID %>").val() &&
                $("#<%= hd_年度.ClientID %>").val() == $("#<%= ddl_年度.ClientID %>").val() && "<%= CV_ddl_決算月2.IsValid %>" == "False") {
                args.IsValid = false;
            }
            if ($("#<%= hd_年度.ClientID %>").val() != $("#<%= ddl_年度.ClientID %>").val()) {
                args.IsValid = true;
            }
        }

        function check() {
            ValidatorEnable2(document.getElementById("<%=CV_ddl_決算月1.ClientID  %>"), true);
            ValidatorEnable2(document.getElementById("<%=CV_ddl_決算月2.ClientID  %>"), true);
            if (document.getElementById('ctl00_ContentPlaceHolder1_ddl_決算月').value != "-1") {
                document.getElementById('ctl00_ContentPlaceHolder1_ddl_決算月').style.backgroundColor = "white";
            }
        }
        $(document).ready(function() {
            var HiddenId = $('#<%=HiddenField_ShowText.ClientID %>').attr('id');
            var text = document.getElementById(HiddenId).value;
            if (text == "insert") {
                registerEnterEvent("enter", "<%= btn_登録.ClientID %>", 9);
            }
            else {
                registerEnterEvent("enter", "<%= btn_更新.ClientID %>", 9);
            }
            registerControlToValidation("validation");
        });

    </script>
    
    <asp:HiddenField ID="hd_年度" runat="server" />
    <asp:HiddenField ID="hd_決算月1" runat="server" />
    <asp:HiddenField ID="hd_決算月2" runat="server" />
    <asp:HiddenField ID="HiddenField_ShowText" runat="server" />
    <div class="maindiv1">
        <div class="Header1">
            <span>* 必須</span>
        </div>
        
        <div class="maindiv1" style="margin-top:30px;margin-left: 50px;margin-right: 50px; margin-bottom: 20px;padding-top:20px;padding-bottom:20px; border: dotted 1px Black; min-height:200px">
            
            <div class="detail-admin-row" >
                <span class="detail-admin-label">年度 :</span>
                <asp:DropDownList
                    ID="ddl_年度" 
                    runat="server" 
                    style="float:left"
                    CssClass="dropdownlist width1 enter validation"
                    onchange="check();">
                </asp:DropDownList>
                <asp:RequiredFieldValidator 
                    runat="server" 
                    ID="RFV_年度"
                    ControlToValidate="ddl_年度"
                    Display="None"
                    InitialValue="-1"
                    SetFocusOnError ="false"
                    ErrorMessage="" >
                </asp:RequiredFieldValidator> 
            
                <ajaxToolkit:ValidatorCalloutExtender 
                    runat="Server" 
                    ID="VCE_ddl_年度"
                    TargetControlID="RFV_年度" 
                    HighlightCssClass = "invalid"
                    Width="240px"
                    CssClass="CustomValidatorCalloutStyle" 
                    WarningIconImageUrl="../Images/warning.png" >
                </ajaxToolkit:ValidatorCalloutExtender> 
                
                <span class="required-field">*</span>
                <asp:CustomValidator
                    ID= "CV_年度2"
                    runat="server" 
                    ErrorMessage="" 
                    ControlToValidate="ddl_年度" 
                    Display ="None" 
                    SetFocusOnError="false" 
                    
                    onservervalidate="CV_年度2_ServerValidate">
                </asp:CustomValidator> 
                
                <ajaxToolkit:ValidatorCalloutExtender 
                    runat="Server" 
                    ID="VCE_年度2"
                    TargetControlID="CV_年度2" 
                    HighlightCssClass = "invalid2"
                    Width="210px"
                    CssClass="CustomValidatorCalloutStyle" 
                    WarningIconImageUrl="../Images/warning.png" >
                </ajaxToolkit:ValidatorCalloutExtender>
                <span class="detail-admin-label" style="width:120px; float:left; text-align:right">決算月 :</span>
                 <asp:DropDownList 
                    ID = "ddl_決算月"
                    style="float:left"
                    CssClass="dropdownlist width1 enter validation"
                    runat="server">
                        <asp:ListItem Value="-1" Selected="True">[選択]</asp:ListItem>
                        <asp:ListItem Value="1">01月</asp:ListItem>
                        <asp:ListItem Value="2">02月</asp:ListItem>
                        <asp:ListItem Value="3">03月</asp:ListItem>
                        <asp:ListItem Value="4">04月</asp:ListItem>
                        <asp:ListItem Value="5">05月</asp:ListItem>
                        <asp:ListItem Value="6">06月</asp:ListItem>
                        <asp:ListItem Value="7">07月</asp:ListItem>
                        <asp:ListItem Value="8">08月</asp:ListItem>
                        <asp:ListItem Value="9">09月</asp:ListItem>
                        <asp:ListItem Value="10">10月</asp:ListItem>
                        <asp:ListItem Value="11">11月</asp:ListItem>
                        <asp:ListItem Value="12">12月</asp:ListItem>
                </asp:DropDownList>
                <asp:RequiredFieldValidator 
                    runat="server" 
                    ID="RFV_ddl_決算月"
                    ControlToValidate="ddl_決算月"
                    Display="None"
                    InitialValue="-1"
                    SetFocusOnError ="false"
                    ErrorMessage="" > 
                </asp:RequiredFieldValidator> 
            
                <ajaxToolkit:ValidatorCalloutExtender 
                    runat="Server" 
                    ID="VCE_ddl_決算月"
                    TargetControlID="RFV_ddl_決算月" 
                    HighlightCssClass = "invalid1"
                    Width="240px"
                    CssClass="CustomValidatorCalloutStyle" 
                    WarningIconImageUrl="../Images/warning.png" >
                </ajaxToolkit:ValidatorCalloutExtender> 
                <asp:CustomValidator
                    ID= "CV_ddl_決算月1"
                    runat="server" 
                    ErrorMessage="" 
                    ControlToValidate="ddl_決算月"  
                    ClientValidationFunction="Check_年度_決算月1" 
                    Display ="None" 
                    SetFocusOnError="false" onservervalidate="CV_ddl_決算月1_ServerValidate">
                </asp:CustomValidator> 
                
                <ajaxToolkit:ValidatorCalloutExtender 
                    runat="Server" 
                    ID="VCE_ddl_決算月1"
                    TargetControlID="CV_ddl_決算月1" 
                    HighlightCssClass = "invalid2"
                    Width="225px"
                    CssClass="CustomValidatorCalloutStyle" 
                    WarningIconImageUrl="../Images/warning.png" >
                </ajaxToolkit:ValidatorCalloutExtender>
                
                 <asp:CustomValidator
                    ID= "CV_ddl_決算月2"
                    runat="server" 
                    ErrorMessage="" 
                    ControlToValidate="ddl_決算月"  
                    ClientValidationFunction="Check_年度_決算月2" 
                    Display ="None" 
                    SetFocusOnError="false" onservervalidate="CV_ddl_決算月2_ServerValidate">
                </asp:CustomValidator> 
                
                <ajaxToolkit:ValidatorCalloutExtender 
                    runat="Server" 
                    ID="VCE_ddl_決算月2"
                    TargetControlID="CV_ddl_決算月2" 
                    Width="225px"
                    HighlightCssClass = "invalid3"
                    CssClass="CustomValidatorCalloutStyle" 
                    WarningIconImageUrl="../Images/warning.png" >
                </ajaxToolkit:ValidatorCalloutExtender>
                <span class="required-field">*</span>
                
            </div>
            
            <div class="detail-admin-row" >
                <span class="detail-admin-label">
                    <asp:Label
                        ID= "lbl_常勤事務"
                        Text="常勤事務 "
                        ForeColor="Red"
                        runat="server">
                    </asp:Label>
                
                </span>
            </div>
            
            <div class="detail-admin-row" >
               
                <span class="detail-admin-label">男性 :</span>
                <asp:TextBox 
                    ID="txt_男性1" 
                    runat="server"
                    MaxLength="6"
                    CssClass="textbox width1 enter validation"
                    onkeypress="return InputNumberKeys(this, event)"
                    style="text-align:right;ime-mode:disabled; float:left">
                </asp:TextBox>
                
                <asp:RequiredFieldValidator 
                    runat="server" 
                    ID="RFV_男性1"
                    ControlToValidate="txt_男性1"
                    Display="None"
                    SetFocusOnError ="false"
                    ErrorMessage="" >
                </asp:RequiredFieldValidator> 
            
                <ajaxToolkit:ValidatorCalloutExtender 
                    runat="Server" 
                    ID="VCE_男性1"
                    TargetControlID="RFV_男性1" 
                    HighlightCssClass = "invalid"
                    Width="240px"
                    CssClass="CustomValidatorCalloutStyle" 
                    WarningIconImageUrl="../Images/warning.png" >
                </ajaxToolkit:ValidatorCalloutExtender> 
                
                <span class="required-field">*</span>
                <span class="detail-admin-label" style="width:120px; float:left; text-align:right">女性 :</span>
                 <asp:TextBox 
                    ID="txt_女性1" 
                    runat="server" 
                    MaxLength="6"
                    CssClass="textbox width1 enter validation"
                    onkeypress="return InputNumberKeys(this, event)"
                    style="text-align:right;float:left; ime-mode:disabled">
                </asp:TextBox>
                
                <asp:RequiredFieldValidator 
                    runat="server" 
                    ID="RFV_女性1"
                    ControlToValidate="txt_女性1"
                    Display="None"
                    SetFocusOnError ="false"
                    ErrorMessage="" >
                </asp:RequiredFieldValidator> 
            
                <ajaxToolkit:ValidatorCalloutExtender 
                    runat="Server" 
                    ID="VCE_女性1"
                    TargetControlID="RFV_女性1" 
                    HighlightCssClass = "invalid"
                    Width="240px"
                    CssClass="CustomValidatorCalloutStyle" 
                    WarningIconImageUrl="../Images/warning.png" >
                </ajaxToolkit:ValidatorCalloutExtender> 
                
                <span class="required-field">*</span>
            </div>
            
            <div class="detail-admin-row" >
                <span class="detail-admin-label">
                    <asp:Label
                        ID= "lbl_非常勤事務"
                        Text="非常勤事務"
                        ForeColor="Red"
                        runat="server">
                    </asp:Label>
                
                </span>
            </div>
            
            <div class="detail-admin-row">
                <span class="detail-admin-label">男性 :</span>
                <asp:TextBox 
                    ID="txt_男性2" 
                    runat="server" 
                    MaxLength="6"
                    CssClass="textbox width1 enter validation"
                    onkeypress="return InputNumberKeys(this, event)"
                    style="text-align:right;ime-mode:disabled; float:left">
                </asp:TextBox>
                
                <asp:RequiredFieldValidator 
                    runat="server" 
                    ID="RFV_男性2"
                    ControlToValidate="txt_男性2"
                    Display="None"
                    SetFocusOnError ="false"
                    ErrorMessage="" >
                </asp:RequiredFieldValidator> 
            
                <ajaxToolkit:ValidatorCalloutExtender 
                    runat="Server" 
                    ID="VCE_男性2"
                    TargetControlID="RFV_男性2" 
                    HighlightCssClass = "invalid"
                    Width="240px"
                    CssClass="CustomValidatorCalloutStyle" 
                    WarningIconImageUrl="../Images/warning.png" >
                </ajaxToolkit:ValidatorCalloutExtender> 
                <span class="required-field">*</span>
                <span class="detail-admin-label" style="width:120px; float:left; text-align:right">女性 :</span>
                 <asp:TextBox 
                    ID="txt_女性2"
                    runat="server" 
                    CssClass="textbox width1 enter validation"
                    MaxLength="6"
                    onkeypress="return InputNumberKeys(this, event)"
                    style="text-align:right;ime-mode:disabled; float:left">
                </asp:TextBox>
                
                <asp:RequiredFieldValidator 
                    runat="server" 
                    ID="RFV_女性2"
                    ControlToValidate="txt_女性2"
                    Display="None"
                    SetFocusOnError ="false"
                    ErrorMessage="" >
                </asp:RequiredFieldValidator> 
            
                <ajaxToolkit:ValidatorCalloutExtender 
                    runat="Server" 
                    ID="VCE_女性2"
                    TargetControlID="RFV_女性2" 
                    HighlightCssClass = "invalid"
                    Width="240px"
                    CssClass="CustomValidatorCalloutStyle" 
                    WarningIconImageUrl="../Images/warning.png" >
                </ajaxToolkit:ValidatorCalloutExtender> 
                <span class="required-field">*</span>
            </div>
           
            
            <div class="detail-admin-row" >
                <span class="detail-admin-label" >
                    <asp:Label
                        ID= "lbl_従事者"
                        Text="従事者"
                        ForeColor="Red"
                        runat="server">
                    </asp:Label>
                </span>
            </div>
            
            <div class="detail-admin-row">    
                <span class="detail-admin-label" >男性 :</span>
                <asp:TextBox 
                    ID="txt_男性3" 
                    runat="server" 
                    CssClass="textbox width1 enter validation"
                    MaxLength="6"
                    onkeypress="return InputNumberKeys(this, event)"
                    style="text-align:right; float:left; ime-mode:disabled">
                </asp:TextBox>
                
                <asp:RequiredFieldValidator 
                    runat="server" 
                    ID="RFV_男性3"
                    ControlToValidate="txt_男性3"
                    Display="None"
                    SetFocusOnError ="false"
                    ErrorMessage="" >
                </asp:RequiredFieldValidator> 
            
                <ajaxToolkit:ValidatorCalloutExtender 
                    runat="Server" 
                    ID="VCE_男性3"
                    TargetControlID="RFV_男性3" 
                    HighlightCssClass = "invalid"
                    Width="240px"
                    CssClass="CustomValidatorCalloutStyle" 
                    WarningIconImageUrl="../Images/warning.png" >
                </ajaxToolkit:ValidatorCalloutExtender> 
                <span class="required-field">*</span>
                <span class="detail-admin-label" style="width:120px; float:left; text-align:right">女性 :</span>
                  <asp:TextBox 
                    ID="txt_女性3"
                    runat="server" 
                    MaxLength="6"
                    CssClass="textbox width1 enter validation"
                    onkeypress="return InputNumberKeys(this, event)"
                    style="text-align:right;ime-mode:disabled; float:left">
                </asp:TextBox>
                
                <asp:RequiredFieldValidator 
                    runat="server" 
                    ID="RFV_女性3"
                    ControlToValidate="txt_女性3"
                    Display="None"
                    SetFocusOnError ="false"
                    ErrorMessage="" >
                </asp:RequiredFieldValidator> 
            
                <ajaxToolkit:ValidatorCalloutExtender 
                    runat="Server" 
                    ID="VCE_女性3"
                    TargetControlID="RFV_女性3" 
                    HighlightCssClass = "invalid"
                    Width="240px"
                    CssClass="CustomValidatorCalloutStyle" 
                    WarningIconImageUrl="../Images/warning.png" >
                </ajaxToolkit:ValidatorCalloutExtender> 
                
                <span class="required-field">*</span>
            </div>
            
            <div class="detail-admin-row" style="padding-top:15px"  >
                <span class="detail-admin-label" >加入組合員数 :</span>
                <asp:TextBox 
                    ID="txt_加入組合員数" 
                    runat="server" 
                    MaxLength="6"
                    CssClass="textbox width1 enter validation"
                    onkeypress="return InputNumberKeys(this, event)"
                    style="text-align:right;ime-mode:disabled">
                </asp:TextBox>
                
                <asp:RequiredFieldValidator 
                    runat="server" 
                    ID="RFV_加入組合員数"
                    ControlToValidate="txt_加入組合員数"
                    Display="None"
                    SetFocusOnError ="false"
                    ErrorMessage="" >
                </asp:RequiredFieldValidator> 
            
                <ajaxToolkit:ValidatorCalloutExtender 
                    runat="Server" 
                    ID="VCE_加入組合員数"
                    TargetControlID="RFV_加入組合員数" 
                    HighlightCssClass = "invalid"
                    Width="240px"
                    CssClass="CustomValidatorCalloutStyle" 
                    WarningIconImageUrl="../Images/warning.png" >
                </ajaxToolkit:ValidatorCalloutExtender> 
                <span class="required-field">*</span>
            </div>
        </div>
        
        <div class="detail-admin-row">
            <span class="detail-admin-label" style="width:250px">&nbsp;</span>
            <asp:Button ID="btn_登録" 
                runat="server" 
                Text="登録" 
                OnClientClick="javascript:focusToControlErr();"
                CssClass="btn" 
                onclick="btn_登録_Click" 
                Height="27px" >
            </asp:Button>
            <asp:Button
                ID="btn_更新"
                runat="server"
                Text="更新"
                OnClientClick="focusToControlErr();"
                CssClass="btn" 
                onclick="btn_更新_Click" 
                Height="27px">
            </asp:Button>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button 
                ID="btn_リセット" 
                runat="server" 
                CausesValidation="false"
                Text="クリア" 
                CssClass="btn" 
                Height="27px"
                onclick="btn_リセット_Click" >
            </asp:Button>
        </div>
        
        <div class="Header1" style="margin-bottom:30px">
            <span>* 本社履歴情報一覧</span>
        </div>
        
        <div style="margin: 10px 20px 20px 50px; width:695px " class="detail-admin-row">
             <%--<asp:Panel ScrollBars="Horizontal" runat="server" ID="abc" Width="690px">--%>
             
                <asp:GridView 
                ID="grv_本社履歴情報一覧" 
                runat="server" 
                AutoGenerateColumns="False" 
                CssClass="mGrid"
                AllowPaging="true" 
                PageSize="10"  
                GridLines="Vertical" 
                width="690px"
                PagerStyle-CssClass="pgr" 
                AlternatingRowStyle-CssClass="alt"
                AllowSorting="false" onrowcreated="grv_RowCreated" 
                onrowcommand="grv_本社履歴情報一覧_RowCommand" 
                onrowdatabound="grv_本社履歴情報一覧_RowDataBound" 
                onpageindexchanging="grv_本社履歴情報一覧_PageIndexChanging">
                    <Columns>
                        <asp:BoundField 
                            HeaderText="年度" 
                            DataField="年度" 
                            ItemStyle-HorizontalAlign="Center"
                            ItemStyle-Width="80px"/>
                            
                        <asp:BoundField 
                            HeaderText="決算月" 
                            DataField="決算月" 
                            ItemStyle-HorizontalAlign="Right"
                            ItemStyle-Width="80px" />
                            
                        <asp:BoundField 
                            HeaderText="男性" 
                            DataField="男性1" 
                            ItemStyle-HorizontalAlign="Right"
                            ItemStyle-Width="80px" />
                            
                        <asp:BoundField 
                            HeaderText="女性" 
                            DataField="女性1" 
                            ItemStyle-HorizontalAlign="Right"
                            ItemStyle-Width="80px" />
                            
                        <asp:BoundField 
                            HeaderText="男性" 
                            DataField="男性2" 
                            ItemStyle-HorizontalAlign="Right"
                            ItemStyle-Width="80px" />
                            
                        <asp:BoundField 
                            HeaderText="女性" 
                            DataField="女性2" 
                            ItemStyle-HorizontalAlign="Right"
                            ItemStyle-Width="80px" />
                            
                        <asp:BoundField 
                            HeaderText="男性" 
                            DataField="男性3" 
                            ItemStyle-HorizontalAlign="Right"
                            ItemStyle-Width="80px" />
                            
                        <asp:BoundField 
                            HeaderText="女性" 
                            DataField="女性3" 
                            ItemStyle-HorizontalAlign="Right"
                            ItemStyle-Width="80px" />
                            
                        <asp:BoundField 
                            HeaderText="加入組合員数" 
                            DataField="加入組合員数" 
                            ItemStyle-HorizontalAlign="Right"
                            ItemStyle-Width="100px" />
                            
                        <asp:ButtonField 
                            Text="Button" 
                            CommandName="Load" 
                            Visible="false"/>
                    </Columns>
            </asp:GridView>
            <%--</asp:Panel>--%>
        </div>
        
        <div class="detail-admin-row">
            <div class="btn_back">
                <asp:Button 
                    ID="btn_戻る" 
                    runat="server" 
                    Text="←戻る"  
                    CssClass="btn" 
                    Height="27px"
                    CausesValidation="False" 
                    onclick="btn_戻る_Click" />
            </div>
            <div class="btn_next">
                <asp:Button 
                    ID="btn_次" 
                    runat="server" 
                    Text="次→" 
                    CssClass="btn"
                    Height="27px" 
                    CausesValidation="False" 
                    onclick="btn_次_Click" />
            </div>
        </div>
        
    </div>
</asp:Content>

